<?php

namespace App\Jobs;

use App\Helpers\PerFormanceTrait;
use App\Models\Bill;
use App\Models\Company;
use App\Models\OnJobLog;
use App\Models\PerformanceTable;
use App\Models\Student;
use App\Models\SystemUser;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\DB;

class UnbindCompany implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, PerFormanceTrait;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
         Company::query()
            ->where('bind_at','>',now())
            ->where('grade','>',0)
             ->update(['staff_id'=>0,'stakeholder_id'=>0,'bind_at'=>null]);
    }


}
